PascalScada 0.7.3 has been modified to improve some aspects. May be this document does not apply on later versions. 1. Communication statistics in TTag and derived TTag class contains statistics about read/write communications: 4 counters which count the number of succeeded and failed operations, for both reading and writing. Problem was that there was no way provided to clear or reset them, so after changing the communication port, old errors were still counted in. A public method has been added to TTag class: (in file tag.pas the following public method has been added:) procedure TTag.ResetStatsCounters; begin PCommReadErrors := 0; PCommReadOK := 0; PCommWriteErrors := 0; PCommWriteOk := 0; end; This method can be called at any moment. The Ministep setup utility calls it just after closing the currently open communication port. 2. Images for THMIAnimation (and TGraphicZone) These classes can load pictures directly from disk. The pictures can be comfortably indicated in the form editor, and their file names are saved inside the project (and executable). Problem was that filenames were stored with absolute paths, which can vary among different machines; this was quite annoying. The solution is to design a more flexible management: the absolute path is still tried to load a picture but, if the file is not found, then the current directory is tried and, if not found again, a subdirectory named "images" is tried. This mechanism also permits to put the images in a directory alone, separated from the executable. To achieve this, two classes has been modified: (in file hmizones.pas, the old method is replaced by this one:) procedure TGraphicZone.SetFileName(fn: AnsiString); var notify:Boolean; fn2 : Ansistring; begin fn := trim(fn); if not FileExists(fn) then begin fn2 := ExtractFileName(fn); if not FileExists(fn2) then begin fn2 := 'images' + DirectorySeparator + fn2; if not FileExists(fn2) then raise exception.Create(SfileNotFound); end; end; notify := (fn<>FFileName); FFileName := fn; if notify then NotifyChange; end; (in file hmianimation.pas the method THMIAnimation.ShowZone is replaced by this one:) procedure THMIAnimation.ShowZone(zone:TGraphicZone); {$IFNDEF FPC} var x:TPicture; {$ENDIF} // tries to load picture in different places function ZLoadInImages(fn: Ansistring): boolean; begin result := FileExists(fn); if result then begin Picture.LoadFromFile(fn); end else begin fn := ExtractFileName(fn); if not FileExists(fn) then fn := 'images' + DirectorySeparator + fn; result := FileExists(fn); if result then Picture.LoadFromFile(fn) end end; begin FCurrentZone:=zone; {$IFDEF FPC} //limpa a imagem //Clears the image Picture.Clear; {$ELSE} x:= TPicture.Create; self.Picture.Assign(x); x.Destroy; {$ENDIF} if zone<>nil then begin if zone.ImageListAsDefault then begin if Assigned(zone.ImageList) AND (zone.ImageIndex<>-1) then begin zone.ImageList.GetBitmap(zone.ImageIndex, Picture.Bitmap); Repaint; end else ZLoadInImages(zone.FileName) end else begin if not ZLoadInImages(zone.FileName) then if Assigned(zone.ImageList) AND (zone.ImageIndex<>-1) then begin zone.ImageList.GetBitmap(zone.ImageIndex, Picture.Bitmap); Repaint; end; end; Transparent := zone.Transparent; if zone.Transparent then Picture.Bitmap.TransparentColor:=zone.TransparentColor; if Assigned(FZoneChanged) then FZoneChanged(Self, zone.Index); end else if Assigned(FZoneChanged) then FZoneChanged(Self, -1); end;